var CheckerMaterial = function(diffuse, specular, reflect, refract, scale) {
	this.specular = specular
	this.diffuse = diffuse;
	this.reflect = reflect;
	this.refract = refract;
	this.scale = scale;
	this.black = new Color(0.1, 0.1, 0.1);
};

CheckerMaterial.prototype.sample = function(ray, position, normal, scene) {
	var u = position.dot(scene.right);
	var v = position.dot(scene.up);
	return Math.abs((Math.floor(u * this.scale) + Math.floor(v * this.scale)) % 2) < 1 ? this.black : Color.white;
};

var PhoneMaterial = function(diffuse, specular, reflect, refract, color, rindex) {
	this.diffuse = diffuse;
	this.specular = specular;
	this.reflect = reflect;
	this.refract = refract;
	this.color = color
	this.rindex= rindex;
};

PhoneMaterial.prototype.sample = function(ray, position, normal, scene) {
	return this.color;
	var NdotL = normal.dot(lightDir);
	var H = (lightDir.subtract(ray.direction)).normalize();
	var NdotH = normal.dot(H);
	var diffuseTemp = this.diffuse.multiply(Math.max(NdotL, 0));
	var specularTemp = this.specular.multiply(Math.pow(Math.max(NdotH), this.shininess));
	return lightColor.modulate(diffuseTemp.add(specularTemp));
};